<!doctype html>
<html style='font-size:15px !important'>
<head>
<meta charset='UTF-8'><meta name='viewport' content='width=device-width initial-scale=1'>
<title>python环境的配置</title>
<script src="https://code.jquery.com/jquery-3.4.1.min.js"></script>
<!-- typora md 样式可以修改-->
<link href="http://gismsl.gitee.io/html/css/theme/vlook-hope.css" rel="stylesheet" />
<link href="http://gismsl.gitee.io/html/css/index.css" rel="stylesheet" />
<script src="http://gismsl.gitee.io/html/js/index.js"></script>
<script src="http://gismsl.gitee.io/html/js/template.js"></script>
</head>

<body class='typora-export os-windows' ><body class='typora-export os-windows' >
<div  id='write'  class = 'is-node'><div class='md-toc' mdtype='toc'><p class="md-toc-content" role="list"><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n2"><a class="md-toc-inner" href="#同时包含python2和python3的配置">同时包含python2和python3的配置</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n5"><a class="md-toc-inner" href="#安装python">安装python</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n6"><a class="md-toc-inner" href="#安装python27">安装python2.7</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n8"><a class="md-toc-inner" href="#安装python37">安装python3.7</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n10"><a class="md-toc-inner" href="#修改pip源">修改pip源</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n12"><a class="md-toc-inner" href="#python2包的配置">python2包的配置</a></span><span role="listitem" class="md-toc-item md-toc-h1" data-ref="n30"><a class="md-toc-inner" href="#python3包的配置">python3包的配置</a></span><span role="listitem" class="md-toc-item md-toc-h2" data-ref="n97"><a class="md-toc-inner" href="#gdal的安装">GDAL的安装</a></span></p></div><h1><a name="同时包含python2和python3的配置" class="md-header-anchor"></a><span>同时包含python2和python3的配置</span></h1><p><a href='https://blog.csdn.net/qq_27089287/article/details/79114441' target='_blank' class='url'>https://blog.csdn.net/qq_27089287/article/details/79114441</a></p><p><strong><span>注意：在设置环境变量时，在cmd中使用python时默认为环境变量在前的python版本。</span></strong></p><h1><a name="安装python" class="md-header-anchor"></a><span>安装python</span></h1><h2><a name="安装python27" class="md-header-anchor"></a><span>安装python2.7</span></h2><p><span>下载网址：</span><a href='https://www.python.org/downloads/' target='_blank' class='url'>https://www.python.org/downloads/</a></p><h2><a name="安装python37" class="md-header-anchor"></a><span>安装python3.7</span></h2><p><span>下载网址：</span><a href='https://www.python.org/downloads/' target='_blank' class='url'>https://www.python.org/downloads/</a></p><h1><a name="修改pip源" class="md-header-anchor"></a><span>修改pip源</span></h1><p><span>配置：</span><a href='https://blog.csdn.net/yuzaipiaofei/article/details/80891108' target='_blank' class='url'>https://blog.csdn.net/yuzaipiaofei/article/details/80891108</a></p><h1><a name="python2包的配置" class="md-header-anchor"></a><span>python2包的配置</span></h1><figure><table><thead><tr><th><span>包名</span></th><th><span>版本</span></th><th><span>描述</span></th></tr></thead><tbody><tr><td><span>numpy</span></td><td><span>1.16.5</span></td><td><span>数据处理包</span></td></tr><tr><td><span>scikit-learn</span></td><td><span>0.20.4</span></td><td><span>机器学习包</span></td></tr><tr><td><span>pandas</span></td><td><span>0.24.2</span></td><td><span>表格文件操作包</span></td></tr></tbody></table></figure><h1><a name="python3包的配置" class="md-header-anchor"></a><span>python3包的配置</span></h1><figure><table><thead><tr><th><span>包名</span></th><th><span>命令</span></th><th><span>版本</span></th><th><span>描述</span></th></tr></thead><tbody><tr><td><span>numpy</span></td><td><span>pip3 install numpy</span></td><td><span>1.17.2</span></td><td><span>数据处理包</span></td></tr><tr><td><span>scikit-learn</span></td><td><span>pip3 install scikit-learn</span></td><td><span>0.20.4</span></td><td><span>机器学习包</span></td></tr><tr><td><span>pandas</span></td><td><span>pip3 install pandas</span></td><td><span>0.25.1</span></td><td><span>表格文件操作包</span></td></tr><tr><td><span>tensorflow</span></td><td><span>pip3 install tensorflow</span></td><td><span>2.0.0</span></td><td><span>深度学习包</span></td></tr><tr><td><span>keras</span></td><td><span>pip3 install keras</span></td><td><span>2.3.1</span></td><td><span>深度学习封装包</span></td></tr><tr><td><span>matplotlib</span></td><td><span>pip3 install matplotlib</span></td><td><span>3.1.1</span></td><td><span>画图显示工具</span></td></tr><tr><td><span>gdal</span></td><td><span>见下</span></td><td>&nbsp;</td><td><span>栅格和矢量文件操作包</span></td></tr><tr><td><span>network</span></td><td><span>pip3 install network</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><span>preprocessing</span></td><td><span>pip3 install preprocessing</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><span>metrics</span></td><td><span>pip3 install metrics</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td><span>cv2</span></td><td><span>pip install opencv-python</span></td><td>&nbsp;</td><td>&nbsp;</td></tr><tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr></tbody></table></figure><h2><a name="gdal的安装" class="md-header-anchor"></a><span>GDAL的安装</span></h2><p><span>目前3.6使用gdal2.2.4比较适合</span></p><blockquote><p><span>conda install gdal=2.2.4</span></p></blockquote><p><span>在该地址</span></p><p><a href='http://www.gisinternals.com/query.html?content=filelist&amp;file=release-1900-x64-gdal-3-0-0-mapserver-7-4-0.zip' target='_blank' class='url'>http://www.gisinternals.com/query.html?content=filelist&file=release-1900-x64-gdal-3-0-0-mapserver-7-4-0.zip</a></p><p><span>下载对应自己安装的python版本；</span></p><ul><li><span>GDAL core components（gdal-300-1900-x64-core.msi）</span></li><li><span>GDAL python bindings（对应python版本，我这里选择的是3.7，GDAL-3.0.0.win-amd64-py3.7.msi）</span></li></ul><p><strong><span>步骤：</span></strong></p><ul><li><span>安装gdal-300-1900-x64-core.msi</span></li><li><span>配置环境变量（path和GDAL_DATA）。</span></li><li><span>安装GDAL-3.0.0.win-amd64-py3.7.msi。</span></li><li><span>测试是否安装成功，在cmd中输入python，然后输入from osgeo import gdal</span></li></ul></div>
</body>
</html>